<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
    var myMath = {
        PI:3.1415926,
        max: function() {
            if(arguments.length === 0) return -Infinity
            var arrMax = arguments[0]
            for (var i = 1;i<arguments.length;i++) {
                if(arguments[i] > arrMax) {
                    arrMax = arguments[i]
                }
            }
            return arrMax
        },
        min: function() {
            if(arguments.length === 0) return -Infinity
            var arrMax = arguments[0]
            for (var i = 1;i<arguments.length;i++) {
                if(arguments[i] < arrMax) {
                    arrMax = arguments[i]
                }
            }
            return arrMax
        }
    }
     console.log(myMath.max(22,11,4));  
     console.log(myMath.min(22,11,4));  
    </script>
</body>
</html>